import request from '@/utils/request'

/**
 * 开票列表
 * http://192.168.88.247:4999/web/#/340/3106
 * @param {*} data
 * @returns
 */
export function listInvoice (data) {
  return request({
    url: '/v1/invoice/list',
    // method: 'get',
    // params: query
    method: 'post',
    data
  })
}

/**
 * 更新开票信息
 * http://192.168.88.247:4999/web/#/340/3107
 * @param {*} data
 * @returns
 */
export function invoiceUpdate (data) {
  return request({
    url: '/v1/invoice/update',
    method: 'post',
    data
  })
}

/**
 * 申请开票
 *http://192.168.88.247:4999/web/#/340/3401
 * @param {*} data
 * @returns
 */
export function invoiceAdd (data) {
  return request({
    url: '/v1/invoice/create',
    method: 'post',
    data
  })
}

/**
 * 审核开票信息
 * http://192.168.88.247:4999/web/#/340/3108
 * @param {*}
 * @returns
 */
export function invoiceCheck (data) {
  return request({
    url: '/v1/invoice/check',
    method: 'post',
    data
  })
}

/**
 * 报废开票
 * http://192.168.88.247:4999/web/#/340/3109
 * @param {*}
 * @returns
 */
export function invoiceCancel (data) {
  return request({
    url: '/v1/invoice/cancel',
    method: 'post',
    data
  })
}

/**
 * 删除开票信息
 * http://192.168.88.247:4999/web/#/340/3114
 * @param {*}
 * @returns
 */
export function invoiceDelete (data) {
  return request({
    url: '/v1/invoice/delete',
    method: 'post',
    data
  })
}

/**
 * 导出开票信息列表
 * http://192.168.88.247:4999/web/#/340/3115
 * @param {*}
 * @returns
 */
export function invoiceExpose (data) {
  return request({
    url: '/v1/invoice/expose',
    method: 'post',
    data,
    responseType: 'blob',
    noInterceptors: true,
    timeout: 0
  })
}
